/*
 *  Things.js
 *  created by qinghong
 *  2016-7-11
 */

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    Navigator,
    Image,
    ScrollView
} from 'react-native';

import Moment from 'moment';
import constant from './constant';

export default class Things extends Component {

    render() {

        //let dateStr = Moment().format('MMMM DD, YYYY');
        //let imgUrl = this.state.thingsData.strBu;
        //let title = this.state.thingsData.strTt;
        //let content = this.state.thingsData.strTc;


        let dateStr = Moment().format('MMMM DD, YYYY');
        let imgUrl = "http://pic65.nipic.com/file/20150419/8684504_205612692746_2.jpg";
        let title = "今日好货";
        let content = "这是今日的好货,哈哈哈哈哈哈哈哈哈";

        return (
            <View style={styles.thing}>
                <ScrollView style={styles.scrollView}>
                    <Text style={{marginLeft: 10, marginTop: 10, fontSize: 12}}>{dateStr}</Text>
                    <Image source={{uri: imgUrl}}
                           style={styles.image}/>
                    <Text style={{fontSize: 17, marginTop: 15, marginLeft: 10}}>
                        {title}
                    </Text>
                    <Text style={{fontSize: 14, marginTop: 15, marginLeft: 10}}>
                        {content}
                    </Text>
                </ScrollView>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    thing: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        paddingTop: 64,
        paddingBottom: 49
    },
    scrollView: {
        width: constant.window.screenWidth,
        height: constant.window.screenHeight - 64 - 49
    },
    image: {
        height: 350,
        justifyContent: 'center',
        marginLeft: 10,
        marginRight: 10,
        marginTop: 15
    }
});

